home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / flowee.c < prev    next >
C/C++ Source or Header  |  1991-07-05  |  1KB  |  47 lines

  1. /*****************************************************************************
  2.  
  3.     FlowEE()
  4.  
  5.     This function moves the command string pointer to the next matching
  6. ' or | character in the command string.  It is called when a conditional
  7. command (e.g. "E) is encountered and the condition fails, or when an F|
  8. command is encountered.
  9.  
  10. *****************************************************************************/
  11.  
  12. #include "zport.h"        /* define portability identifiers */
  13. #include "tecoc.h"        /* define general identifiers */
  14. #include "defext.h"        /* define external global variables */
  15. #include "deferr.h"        /* define identifiers for error messages */
  16.  
  17. DEFAULT FlowEE()        /* flow to else or end (| or ') */
  18. {
  19.     WORD    TmpNst;
  20.  
  21.     TmpNst = 1;
  22.     do {
  23.         if (CBfPtr == CStEnd) {
  24.             ErrUTC();        /* unterminated command */
  25.             return FAILURE;
  26.         }
  27.         ++CBfPtr;
  28.         if ((*CBfPtr == '|') && (TmpNst == 1)) {
  29.             break;
  30.         }
  31.         if (*CBfPtr == '"') {
  32.             ++TmpNst;
  33.         } else if (*CBfPtr == '\'') {
  34.             --TmpNst;
  35.         }
  36.         if (SkpCmd() == FAILURE) {
  37.             return FAILURE;
  38.         }
  39.     } while (TmpNst > 0);
  40.  
  41.     if (TraceM) {
  42.         EchoIt(*CBfPtr);
  43.     }
  44.  
  45.     return SUCCESS;
  46. }
  47.